<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>HtmlUtilitiesTest</title>

<link rel="stylesheet"
	href="http://code.jquery.com/qunit/qunit-1.15.0.css">
<script src="http://code.jquery.com/qunit/qunit-1.15.0.js"></script>
<script src="../../../main/js/util/HtmlUtilities.js"></script>

<script>
    QUnit.test("HtmlUtilities.addClass()", function(assert)
    {
        // Setup.
        var element = document.getElementById("div1");
        assert.ok(HtmlUtilities.hasClass(element, "one"));
        assert.ok(!HtmlUtilities.hasClass(element, "two"));

        // Run.
        HtmlUtilities.addClass(element, "two");

        // Verify.
        assert.ok(HtmlUtilities.hasClass(element, "one"));
        assert.ok(HtmlUtilities.hasClass(element, "two"));

        // Cleanup.
        HtmlUtilities.removeClass(element, "two");
        assert.ok(HtmlUtilities.hasClass(element, "one"));
        assert.ok(!HtmlUtilities.hasClass(element, "two"));
    });

    QUnit.test("HtmlUtilities.hasClass()", function(assert)
    {
        var element = document.getElementById("div1");
        assert.ok(HtmlUtilities.hasClass(element, "one"));
        assert.ok(!HtmlUtilities.hasClass(element, "two"));
    });

    QUnit.test("HtmlUtilities.removeClass()", function(assert)
    {
        // Setup.
        var element = document.getElementById("div1");
        assert.ok(HtmlUtilities.hasClass(element, "one"));
        assert.ok(!HtmlUtilities.hasClass(element, "two"));

        // Run.
        HtmlUtilities.removeClass(element, "one");

        // Verify.
        assert.ok(!HtmlUtilities.hasClass(element, "one"));
        assert.ok(!HtmlUtilities.hasClass(element, "two"));

        // Cleanup.
        HtmlUtilities.addClass(element, "one");
        assert.ok(HtmlUtilities.hasClass(element, "one"));
        assert.ok(!HtmlUtilities.hasClass(element, "two"));
    });
</script>
</head>
<body>
	<div id="qunit"></div>
	<div id="div1" class="one"></div>
</body>
</html>
